/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package intopo.evogame.partnerselection.config;

import intopo.evogame.partnerselection.EvolutionaryAlgorithm;
import intopo.evogame.partnerselection.chromosome.Chromosome;
import intopo.evogame.partnerselection.player.PlainPlayer;
import intopo.evogame.partnerselection.population.Node;
import intopo.game.DescriptionText;
import intopo.game.Game;
import intopo.game.Strategy;
import java.io.PrintStream;
import java.util.Scanner;


/**
 * This abstract class represents a text config file that contains data about simple players.  These players use the simple chromosome, represented
 * by class {@code Chromosome}.  Players are represented by class {@code PlainPlayer}.
 * 
 * <p> This class implements the methods that read and write global parameters that effect the behaviour
 * of all chromosomes and players.
 *
 * @author <a href="mailto:mariano.pedro@gmail.com">Pedro Mariano</a>
 *
 * @version 1.0
 *
 * @param <D> Type parameter that represents the game description.
 * @param <G> Type parameter that represents the game that is going to be used in the evoluationary algorithm.
 * @param <S> Type parameter that represents the game strategy that is going to be used by players in the evolutionary algorithm.
 */
abstract class AbstractTextConfigFilePlainPlayers<
		D extends DescriptionText<G, S>,
		G extends Game<S>,
		S extends Strategy<S>>
	extends AbstractTextConfigFile<D, G, S>
{
	protected AbstractTextConfigFilePlainPlayers (D description)
	{
		super (description);
	}

	@Override
	final protected void readGlobalParameters (Scanner scanner)
		throws ParsingException
	{
		Chromosome.Parameters.read (scanner);
		PlainPlayer.Parameters.read (scanner);
		EvolutionaryAlgorithm.Parameters.read (scanner);
		Node.Parameters.read (scanner);
	}

	@Override
	final protected void writeGlobalParameters (PrintStream ps)
	{
		Chromosome.Parameters.write (ps);
		PlainPlayer.Parameters.write (ps);
		EvolutionaryAlgorithm.Parameters.write (ps);
		Node.Parameters.write (ps);
	}
}

// Local Variables:
// mode: java
// mode: flyspell-prog
// ispell-local-dictionary: "british"
// End:
